import Field from '@model/entity/Field';
import {t as $t} from '@src/locales';

enum RoleViewFormFieldNameEnum {
  Name = 'name',
  Description = 'description',
}

const getFields: (isDisabled: boolean) => Field[] = (isDisabled: boolean) => {
  return [
    {
      fieldName: RoleViewFormFieldNameEnum.Name,
      displayName: $t('common.base.roleName'),
      formType: 'text',
      placeHolder: $t('common.placeholder.inputRoleName'),
      isSystem: 1,
      isNull: 0,
      width: 210,
      maxlength: 50,
      disabled: isDisabled
    },
    {
      fieldName: RoleViewFormFieldNameEnum.Description,
      formType: 'textarea',
      displayName: $t('common.base.roleDesc'),
      placeHolder: $t('common.placeholder.inputRoleDesc'),
      isSystem: 1,
      isNull: 1,
      width: 210,
      maxlength: 500
    },

    {
      fieldName: 'qualificationIds',
      formType: 'select',
      displayName: $t('qualificationManagement.view.label13'),
      placeHolder: $t('common.placeholder.select'),
      isSystem: 1,
      isNull: 1,
      width: 210,
    },
  ]
}

export {
  getFields,
  RoleViewFormFieldNameEnum
}